package com.faxsun.profile.core.service;

import java.util.List;

import org.broadleafcommerce.core.pricing.service.exception.PricingException;
import org.broadleafcommerce.profile.core.domain.Customer;
import org.broadleafcommerce.profile.core.service.CustomerService;

import com.faxsun.profile.core.domain.FSReceiver;
import com.faxsun.profile.core.domain.FSThirdPartyCustomer;

public interface FSCustomerService extends CustomerService {

	/**
	 * 获取该账户下维护的收件人身份证信息
	 * @param customer
	 * @return
	 */
	public List<FSReceiver> readReceivers(Long id);

	/*
	 * 第三方用户
	 */
	public Customer easyRegisterCustomer(Customer customer, String password);
	
    public List<FSThirdPartyCustomer> getThirdPartyCustomer(Customer customer);
	
    public boolean isCustomer3th(String uid);

	/**
	 * 手机号是否已绑定
	 * @param mobile
	 * @return
	 */
	public boolean isMobileBinded(String mobile);

	/*
	 * Merge [from customer] to [to customer], then de_active the from one.
	 */
	public void mergeCustomers(Customer from, Customer to)  throws PricingException;

	public Customer readCustomerByReferralCode(String referralCode);

	public String readOrGenerateReferralCodeForCustomer(Customer customer);
	
	/**
	 * 统计email为指定email的用户数
	 * @param email
	 * @return
	 */
	public int countCustomerByEmail(String email);
}
